$("#regist").click(function (){
    var tel = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/;
    var name = $("#name").val();
    var pwd = $("#pwd").val();
    var repwd = $("#repwd").val();
    var phone = $("#phone").val();
    var rename = $("#rename").val();
    if (name == ""){
        $("#namemsg").html("用户名不能为空");
    }else if (pwd == ""){
        $("#pwdmsg").html("密码不能为空");
    }else if (repwd == ""){
        $("#repwdmsg").html("请确认密码");
    }else if (pwd != repwd){
        $("#repwdmsg").html("两次密码不一致");
    }else if (phone == ""){
        $("#phonemsg").html("电话不能为空");
    }else if (!tel.test(phone)){
        $("#phonemsg").html("电话格式不正确");
    } else if (rename == ""){
        $("#renamemsg").html("姓名不能为空");
    }else{
        document.location = "registUser?uname="+name+"&upwd="+repwd+"&phone="+phone+"&rename="+rename+"";
    }
})